package edu.jd.eventhandler;

import edu.jd.authoritymanagement.Authority;
import edu.jd.authoritymanagement.AuthorityController;

import javax.swing.*;


public class EventHandler {
    public static void handleEvent(Authority requireAuth, EventExecutor executor, JFrame root){
        boolean isAllow = AuthorityController.get().checkAuthority(requireAuth);
        if(isAllow){
            if(executor!=null)
                executor.execute();
        }else{
            JOptionPane.showMessageDialog(root, "你没有权限！");
        }
    }
}
